package com.genokon.util;

import org.springframework.data.redis.core.RedisTemplate;

/**
 * @author by baichaoda
 * @date 2020/9/18 13:36
 */
public class CacheUtil {

    private static final RedisTemplate<String, Object> redisTemplate = SpringUtil.getBean("redisTemplate");

    public static void set(String key, Object obj){
        redisTemplate.opsForValue().set(key, obj);
    }

    public static Object get(String key){
        return redisTemplate.opsForValue().get(key);
    }
}
